﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NMoq.Core
{
    public class MethodCallIdentifier:IIdentifier
    {
        #region IIdentifier Members

        public int GetIdentifier(MethodMessageInfo methodMessageInfo)
        {
            string strIndentifier = string.Empty;
            strIndentifier += methodMessageInfo. MethodInfo.GetHashCode().ToString();
            strIndentifier += methodMessageInfo.Target.GetHashCode().ToString();
            strIndentifier += MethodMessageInfo.ConvertArrayToString(Type.GetTypeArray(methodMessageInfo.Args));
            strIndentifier += MethodMessageInfo.ConvertArrayToString(methodMessageInfo.Args);

            return strIndentifier.GetHashCode();
        }

        #endregion
    }
}
